<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="shortcut icon" href="https://exp-blog.com/favicon.png"/>
        <meta name="author" content="EXP: www.exp-blog.com">
        <title>眈眈探求 | ACM常用算法模板</title>
        <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body bgcolor="white" lang="ZH-CN" link="#333333" vlink="#333333" style="tab-interval: 21.0pt">
        <div class="Section1">
            <p align="center" style="text-align:center">
                <strong><span lang="EN-US" style="font-size:14.5pt;font-family:SimSun;mso-bidi-font-family:SimSun; color:black">ACM小组内部预定函数</span></strong>
            </p>
            <p align="right" style="text-align:right">
                <span lang="EN-US" style="font-size:9.0pt; color:#666666">[ <a href="https://exp-blog.com/algorithm/acm-chang-yong-suan-fa-mo-ban/" target="_blank">EXP 博客 - 眈眈探求 : https://exp-blog.com/algorithm/acm-chang-yong-suan-fa-mo-ban/</a> ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
            </p>
            <div align="right">
                <table class="MsoNormalTable" border="0" cellspacing="6" cellpadding="0" width="100%" style="width:100.0%;mso-cellspacing:4.5pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td width="25%" style="width:25.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <strong><span style="font-size:9.0pt;font-family:SimSun; mso-bidi-font-family:SimSun;color:black">数学问题：</span></strong>
                                </p>
                            </td>
                            <td width="25%" style="width:25.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td width="25%" style="width:25.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td width="25%" style="width:25.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#1">1.精度计算——大数阶乘</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#2">2.精度计算——乘法（大数乘小数）</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#3">3.精度计算——乘法（大数乘大数）</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#4">4.精度计算——加法</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#5">5.精度计算——减法</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#6">6.任意进制转换</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#7">7.最大公约数、最小公倍数</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#8">8.组合序列</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#9">9.快速傅立叶变换（FFT）</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#10">10.Ronberg算法计算积分</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#11">11.行列式计算</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#12">12.求排列组合数</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <strong><span style="font-size:9.0pt;font-family:SimSun; mso-bidi-font-family:SimSun;color:black">字符串处理：</span></strong>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#13">1.字符串替换</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#14">2.字符串查找</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#15">3.字符串截取</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <strong><span style="font-size:9.0pt;font-family:SimSun; mso-bidi-font-family:SimSun;color:black">计算几何：</span></strong>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#16">1.叉乘法求任意多边形面积</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#17">2.求三角形面积</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#18">3.两矢量间角度</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#19">4.两点距离（2D、3D）</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#20">5.射向法判断点是否在多边形内部</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#21">6.判断点是否在线段上</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#22">7.判断两线段是否相交</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#23">8.判断线段与直线是否相交</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:11">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#24">9.点到线段最短距离</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#25">10.求两直线的交点</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#26">11.判断一个封闭图形是凹集还是凸集</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#27">12.Graham扫描法寻找凸包</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:12">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:13">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <strong><span style="font-size:9.0pt;font-family:SimSun; mso-bidi-font-family:SimSun;color:black">数论：</span></strong>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:14">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#28">1.x的二进制长度</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#29">2.返回x的二进制表示中从低到高的第i位</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#30">3.模取幂运算</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#31">4.求解模线性方程</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:15">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#32">5.求解模线性方程组(中国余数定理)</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#33">6.筛法素数产生器</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#34">7.判断一个数是否素数</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:16">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:17">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <strong><span style="font-size:9.0pt;font-family:SimSun; mso-bidi-font-family:SimSun;color:black">图论：</span></strong>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:18">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#35">1.Prim算法求最小生成树</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#36">2.Dijkstra算法求单源最短路径</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#37">3.Bellman-ford算法求单源最短路径</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#38">4.Floyd算法求每对节点间最短路径</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:19">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:20">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <strong><span style="font-size:9.0pt;font-family:SimSun; mso-bidi-font-family:SimSun;color:black"><span lang="EN-US">排序/搜索：</span></span></strong>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:21">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#39">1.快速排序</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#40">2.希尔排序</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#41">3.选择排序</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#42">4.二分查找</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:22">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:23">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <strong><span style="font-size:9.0pt;font-family:SimSun; mso-bidi-font-family:SimSun;color:black">数据结构：</span></strong>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:24">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#43">1.顺序队列</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#44">2.顺序栈</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#45">3.链表</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#446">4.链栈</a></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:25;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><a href="#47">5.二叉树</a></span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <br>
                <strong><span style="font-family:SimSun;mso-bidi-font-family:SimSun">一、数学问题</span></strong></span>
            </p>
            <p>
                <a name="1"></a><span lang="EN-US" style="font-size:9.0pt;color:black">1.精度计算——大数阶乘</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">result=factorial(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n 的阶乘</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">阶乘结果的位数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">本程序直接输出<span lang="EN-US">n!的结果，需要返回结果请保留</span></span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[]</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">factorial(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[10000];<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,l,c,m=0,w;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a[0]=1;<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;=n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;c=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;=m;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a[j]=a[j]*i+c;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c=a[j]/10000;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a[j]=a[j]%10000;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(c&gt;0) {m++;a[m]=c;}<br>
                                    }<br>
                                    <br>
                                    w=m*4+log10(a[m])+1;<br>
                                    printf("\n%ld",a[m]);<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=m-1;i&gt;=0;i--) printf("%4.4ld",a[i]);<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">w;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <a name="2"></a>2.精度计算——乘法（大数乘小数）</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">mult(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">c[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">c[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被乘数，用字符串表示，位数不限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">结果，用字符串表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">m：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">乘数，限定<span lang="EN-US">10以内</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">string.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">mult(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">c[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,l,k,flag,add=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s[100];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l=strlen(c);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;l;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s[l-i-1]=c[i]-'0';</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;l;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k=s[i]*m+add;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(k&gt;=10) {s[i]=k%10;add=k/10;flag=1;}</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{s[i]=k;flag=0;add=0;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(flag) {l=i+1;s[i]=add;}</span> <span lang="EN-US" style="font-size:9.0pt; color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l=i;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;l;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t[l-1-i]=s[i]+'0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;t[l]='\0';<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="3"></a><span lang="EN-US" style="font-size:9.0pt;color:black">3.精度计算——乘法（大数乘大数）</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">mult(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被乘数，用字符串表示，位数不限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">b[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">乘数，用字符串表示，位数不限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">结果，用字符串表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">空间复杂度为 <span lang="EN-US">o(n^2)</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">string.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">mult(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k=0,alen,blen,sum=0,res[65][65]={0},flag=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">result[65];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;alen=strlen(a);blen=strlen(b);</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;alen;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;blen;j++) res[i][j]=(a[i]-'0')*(b[j]-'0');</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=alen-1;i&gt;=0;i--)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=blen-1;j&gt;=0;j--) sum=sum+res[i+blen-j-1][j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result[k]=sum%10;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k=k+1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sum=sum/10;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=blen-2;i&gt;=0;i--)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;=i;j++) sum=sum+res[i-j][j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result[k]=sum%10;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k=k+1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sum=sum/10;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(sum!=0) {result[k]=sum;k=k+1;}</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;k;i++) result[i]+='0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=k-1;i&gt;=0;i--) s[i]=result[k-1-i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s[k]='\0';</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(strlen(s)!=strlen(a)&amp;&amp;s[0]=='0')<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strcpy(s,s+1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="4"></a><span lang="EN-US" style="font-size:9.0pt;color:black">4.精度计算——加法</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">add(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被乘数，用字符串表示，位数不限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">b[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">乘数，用字符串表示，位数不限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">结果，用字符串表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">空间复杂度为 <span lang="EN-US">o(n^2)</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">string.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">add(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">back[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k,up,x,y,z,l;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">*c;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(strlen(a)&gt;strlen(b)) l=strlen(a)+2;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l=strlen(b)+2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;c=(</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">*) malloc(l*sizeof(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span><span lang="EN-US" style="font-size:9.0pt;color:black">));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;i=strlen(a)-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;j=strlen(b)-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;k=0;up=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i&gt;=0||j&gt;=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i&lt;0) x='0';&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x=a[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j&lt;0) y='0';&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y=b[j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z=x-'0'+y-'0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(up) z+=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(z&gt;9) {up=1;z%=10;}&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">up=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c[k++]=z+'0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i--;j--;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(up) c[k++]='1';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;i=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;c[k]='\0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(k-=1;k&gt;=0;k--)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;back[i++]=c[k];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;back[i]='\0';<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="5"></a><span lang="EN-US" style="font-size:9.0pt;color:black">5.精度计算——减法</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">sub(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s1[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s2[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">s1[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被减数，用字符串表示，位数不限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">s2[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">减数，用字符串表示，位数不限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">结果，用字符串表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">默认<span lang="EN-US">s1&gt;=s2，程序未处理负数情况</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">string.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">sub(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s1[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s2[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,l2,l1,k;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l2=strlen(s2);l1=strlen(s1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;t[l1]='\0';l1--;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=l2-1;i&gt;=0;i--,l1--)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(s1[l1]-s2[i]&gt;=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t[l1]=s1[l1]-s2[i]+'0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t[l1]=10+s1[l1]-s2[i]+'0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s1[l1-1]=s1[l1-1]-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;k=l1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s1[k]&lt;0) {s1[k]+=10;s1[k-1]-=1;k--;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(l1&gt;=0) {t[l1]=s1[l1];l1--;}<br>
                                    loop:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(t[0]=='0')<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;l1=strlen(s1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;l1-1;i++) t[i]=t[i+1];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t[l1-1]='\0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto loop;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(strlen(t)==0) {t[0]='0';t[1]='\0';}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="6"></a><span lang="EN-US" style="font-size:9.0pt;color:black">6.任意进制转换</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">conversion(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s1[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s2[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d2);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">s[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">原进制数字，用字符串表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">s2[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">转换结果，用字符串表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">d1：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">原进制数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">d2：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要转换到的进制数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">高于<span lang="EN-US">9的位数用大写'A'～'Z'表示，2～16位进制通过验证</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">conversion(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s2[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d2)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,t,num;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">c;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;num=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;s[i]!='\0';i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(s[i]&lt;='9'&amp;&amp;s[i]&gt;='0') t=s[i]-'0';</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t=s[i]-'A'+10;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num=num*d1+t;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;i=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t=num%d2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(t&lt;=9) s2[i]=t+'0';</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s2[i]=t+'A'-10;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num/=d2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(num==0)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;i/2;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{c=s2[j];s2[j]=s[i-j];s2[i-j]=c;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s2[i+1]='\0';<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="7"></a><span lang="EN-US" style="font-size:9.0pt;color:black">7.最大公约数、最小公倍数</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">resulet=hcf(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b)、result=lcd(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b)</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a，求最大公约数或最小公倍数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">b：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b，求最大公约数或最小公倍数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">返回最大公约数（<span lang="EN-US">hcf）或最小公倍数（lcd）</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">lcd 需要连同 hcf 使用</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">hcf(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">r=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(b!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r=a%b;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a=b;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b=r;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(a);<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">lcd(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">u,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">v,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">h)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(u*v/h);<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal" style="margin-bottom:12.0pt">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="8"></a><span lang="EN-US" style="font-size:9.0pt;color:black">8.组合序列</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">m_of_n(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span><span lang="EN-US" style="font-size:9.0pt;color:black">* a,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">head)</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">m：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">组合数<span lang="EN-US">C的上参数</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n1：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">组合数<span lang="EN-US">C的下参数</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">m1：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">组合数<span lang="EN-US">C的上参数，递归之用</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">*a：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">1～n的整数序列数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">head：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">头指针</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">*a需要自行产生</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">初始调用时，<span lang="EN-US">m=m1、head=0</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:11">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">调用例子：求<span lang="EN-US">C(m,n)序列：m_of_n(m,n,m,a,0);</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:12">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:13;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m_of_n(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span><span lang="EN-US" style="font-size:9.0pt;color:black">* a,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">head)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,t;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(m1&lt;0 || m1&gt;n1)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(m1==n1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;m;i++) cout&lt;&lt;a[i]&lt;&lt;' '; // 输出序列<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;'\n';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;m_of_n(m,n1-1,m1,a,head); // 递归调用<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;t=a[head];a[head]=a[n1-1+head];a[n1-1+head]=t;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;m_of_n(m,n1-1,m1-1,a,head+1); // 再次递归调用<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;t=a[head];a[head]=a[n1-1+head];a[n1-1+head]=t;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="9"></a><span lang="EN-US" style="font-size:9.0pt;color:black">9.快速傅立叶变换（FFT）</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">kkfft(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">pr[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">pi[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">k,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">fr[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">fi[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">il);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">pr[n]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输入的实部 </span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">pi[n]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">数入的虚部</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n，k：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">满足<span lang="EN-US">n=2^k</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">fr[n]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输出的实部</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">fi[n]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输出的虚部</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">l：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">逻辑开关，<span lang="EN-US">0 FFT，1 ifFT</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">il：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">逻辑开关，<span lang="EN-US">0 输出按实部/虚部；1 输出按模/幅角</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:11">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:12">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:13;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">kkfft(pr,pi,n,k,fr,fi,l,il)<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,k,l,il;<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">pr[],pi[],fr[],fi[];<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">it,m,is,i,j,nv,l0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">p,q,s,vr,vi,poddr,poddi;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(it=0; it&lt;=n-1; it++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m=it; is=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0; i&lt;=k-1; i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{j=m/2; is=2*is+(m-2*j); m=j;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fr[it]=pr[is]; fi[it]=pi[is];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;pr[0]=1.0; pi[0]=0.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p=6.283185306/(1.0*n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;pr[1]=cos(p); pi[1]=-sin(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(l!=0) pi[1]=-pi[1];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=2; i&lt;=n-1; i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p=pr[i-1]*pr[1];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q=pi[i-1]*pi[1];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s=(pr[i-1]+pi[i-1])*(pr[1]+pi[1]);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pr[i]=p-q; pi[i]=s-p-q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(it=0; it&lt;=n-2; it=it+2)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vr=fr[it]; vi=fi[it];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fr[it]=vr+fr[it+1]; fi[it]=vi+fi[it+1];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fr[it+1]=vr-fr[it+1]; fi[it+1]=vi-fi[it+1];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;m=n/2; nv=2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(l0=k-2; l0&gt;=0; l0--)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m=m/2; nv=2*nv;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(it=0; it&lt;=(m-1)*nv; it=it+nv)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0; j&lt;=(nv/2)-1; j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p=pr[m*j]*fr[it+j+nv/2];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q=pi[m*j]*fi[it+j+nv/2];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s=pr[m*j]+pi[m*j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s=s*(fr[it+j+nv/2]+fi[it+j+nv/2]);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;poddr=p-q; poddi=s-p-q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fr[it+j+nv/2]=fr[it+j]-poddr;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi[it+j+nv/2]=fi[it+j]-poddi;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fr[it+j]=fr[it+j]+poddr;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi[it+j]=fi[it+j]+poddi;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(l!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0; i&lt;=n-1; i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fr[i]=fr[i]/(1.0*n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi[i]=fi[i]/(1.0*n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(il!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0; i&lt;=n-1; i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pr[i]=sqrt(fr[i]*fr[i]+fi[i]*fi[i]);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(fabs(fr[i])&lt;0.000001*fabs(fi[i]))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((fi[i]*fr[i])&gt;0) pi[i]=90.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">pi[i]=-90.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pi[i]=atan(fi[i]/fr[i])*360.0/6.283185306;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="10"></a><span lang="EN-US" style="font-size:9.0pt;color:black">10.Ronberg算法计算积分</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=integral(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">积分上限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">b：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">积分下限</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">function f：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">积分函数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">f在（a,b）之间的积分值</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">function f(x)需要自行修改，程序中用的是sina(x)/x</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">默认精度要求是<span lang="EN-US">1e-5</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:11;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">f(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">sin(x)/x; //在这里插入被积函数<br>
                                    }<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">integral(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">h=b-a;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t1=(1+f(b))*h/2.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">k=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">r1,r2,s1,s2,c1,c2,t2;<br>
                                    loop:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s=0.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x=a+h/2.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(x&lt;b)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s+=f(x);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x+=h;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;t2=(t1+h*s)/2.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s2=t2+(t2-t1)/3.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(k==1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k++;h/=2.0;t1=t2;s1=s2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto loop;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;c2=s2+(s2-s1)/15.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(k==2){<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c1=c2;k++;h/=2.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1=t2;s1=s2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto loop;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;r2=c2+(c2-c1)/63.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(k==3){<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r1=r2;&nbsp;c1=c2;k++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h/=2.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1=t2;s1=s2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto loop;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(fabs(1-r1/r2)&gt;1e-5){<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r1=r2;c1=c2;k++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h/=2.0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1=t2;s1=s2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto loop;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">r2;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="11"></a><span lang="EN-US" style="font-size:9.0pt;color:black">11.行列式计算</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=js(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s[][],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">s[][]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">行列式存储数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">行列式维数，递归用</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">行列式值</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">函数中常数<span lang="EN-US">N为行列式维度，需自行定义</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">js(s,n)<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s[][N],n;<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">z,j,k,r,total=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[N][N];/*b[N][N]用于存放，在矩阵s[N][N]中元素s[0]的余子式*/<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(n&gt;2)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(z=0;z&lt;n;z++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;n-1;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(k=0;k&lt;n-1;k++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(k&gt;=z) b[j][k]=s[j+1][k+1]; &nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[j][k]=s[j+1][k];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(z%2==0) r=s[0][z]*js(b,n-1); /*递归调用*/<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">r=(-1)*s[0][z]*js(b,n-1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;total=total+r;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(n==2)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; total=s[0][0]*s[1][1]-s[0][1]*s[1][0];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">total;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="12"></a><span lang="EN-US" style="font-size:9.0pt;color:black">12.求排列组合数</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=P(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m); / result=</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">C(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">m：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">排列组合的上系数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">排列组合的下系数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">排列组合数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">符合数学规则：<span lang="EN-US">m&lt;＝n</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">P(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">p=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(m!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{p*=n;n--;m--;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">p;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">C(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">long</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,c=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;i=m;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{c*=n;n--;i--;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(m!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{c/=m;m--;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">c;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <strong><span style="font-size:9.0pt;font-family:SimSun;mso-bidi-font-family: SimSun;color:black">二、字符串处理</span></strong>
            </p>
            <p>
                <a name="13"></a><span lang="EN-US" style="font-size:9.0pt;color:black">1.字符串替换</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">replace(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">str[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">key[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">swap[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">str[]：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">在此源字符串进行替换操作</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">key[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被替换的字符串，不能为空串</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">swap[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">替换的字符串，可以为空串，为空串表示在源字符中删除<span lang="EN-US">key[]</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">默认<span lang="EN-US">str[]长度小于1000，如否，重新设定设定tmp大小</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">string.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">replace(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">str[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">key[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">swap[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l1,l2,l3,i,j,flag;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">tmp[1000];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l1=strlen(str);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l2=strlen(key);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l3=strlen(swap);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;=l1-l2;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;l2;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(str[i+j]!=key[j]) {flag=0;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(flag)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strcpy(tmp,str);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strcpy(&amp;tmp[i],swap);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strcpy(&amp;tmp[i+l3],&amp;str[i+l2]);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strcpy(str,tmp);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i+=l3-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;l1=strlen(str);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <a name="14"></a>2.字符串查找</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=strfind(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">str[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">key[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">str[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">在此源字符串进行查找操作</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">key[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被查找的字符串，不能为空串</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">如果查找成功，返回<span lang="EN-US">key在str中第一次出现的位置，否则返回-1</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">string.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">strfind(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">str[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">key[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l1,l2,i,j,flag;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l1=strlen(str);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l2=strlen(key);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;=l1-l2;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;l2;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(str[i+j]!=key[j]) {flag=0;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(flag)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">-1;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="15"></a><span lang="EN-US" style="font-size:9.0pt;color:black">3.字符串截取</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">mid(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">str[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">start,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">len,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">strback[])</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">str[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">操作的目标字符串</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">start：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">从第<span lang="EN-US">start个字符串开始，截取长度为len的字符</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">len：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">从第<span lang="EN-US">start个字符串开始，截取长度为len的字符</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">strback[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">截取的到的字符</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">0：超出字符串长度，截取失败；1：截取成功</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">string.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">mid(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">str[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">start,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">len,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">strback[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l,i,k=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;l=strlen(str);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(start+len&gt;l)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=start;i&lt;start+len;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strback[k++]=str[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;strback[k]='\0';<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <strong><span style="font-size:9.0pt;font-family:SimSun;mso-bidi-font-family: SimSun;color:black">三、计算几何</span></strong>
            </p>
            <p>
                <a name="16"></a><span lang="EN-US" style="font-size:9.0pt;color:black">1.叉乘法求任意多边形面积</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=polygonarea(Point *polygon,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">N);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">*polygon：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">多变形顶点数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">N：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">多边形顶点数目</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">多边形面积</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">支持任意多边形，凹、凸皆可</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">多边形顶点输入时按顺时针顺序排列</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">polygonarea(Point *polygon,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">N)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">area = 0;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;N;i++) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j = (i + 1) % N;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;area += polygon[i].x * polygon[j].y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;area -= polygon[i].y * polygon[j].x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;area /= 2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(area &lt; 0 ? -area : area);<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <a name="17"></a>2.求三角形面积</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=area3(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x3,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y3);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">x1～3：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">三角形<span lang="EN-US">3个顶点x坐标</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">y1～3：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">三角形<span lang="EN-US">3个顶点y坐标</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">三角形面积</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">area3(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x3,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y3)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,b,c,p,s;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;b=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;c=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p=(a+b+c)/2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s=sqrt(p*(p-a)*(p-b)*(p-c));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="18"></a><span lang="EN-US" style="font-size:9.0pt;color:black">3.两矢量间角度</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=angle(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y2);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">x/y1～2：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">两矢量的坐标</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">两的角度矢量</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">返回角度为弧度制，并且以逆时针方向为正方向</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">PI 3.1415926<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">angle(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y1,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y2)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">dtheta,theta1,theta2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;theta1 = atan2(y1,x1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;theta2 = atan2(y2,x2);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;dtheta = theta2 - theta1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(dtheta &gt; PI)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtheta -= PI*2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(dtheta &lt; -PI)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtheta += PI*2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(dtheta);<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="19"></a><span lang="EN-US" style="font-size:9.0pt;color:black">4.两点距离（2D、3D）</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=distance_2d(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y2);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">x/y/z1～2：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">各点的<span lang="EN-US">x、y、z坐标</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">两点之间的距离</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">distance_2d(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y2)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));<br>
                                    }<br>
                                    <br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">distance_3d(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y2,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">z1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">z2)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2)));<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="20"></a><span lang="EN-US" style="font-size:9.0pt;color:black">5.射向法判断点是否在多边形内部</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=insidepolygon(Point *polygon,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">N,Point p);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">*polygon：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">多边形顶点数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">N：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">多边形顶点个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被判断点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">0：点在多边形内部；1：点在多边形外部</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">若<span lang="EN-US">p点在多边形顶点或者边上，返回值不确定，需另行判断</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MIN(x,y) (x &lt; y ? x : y)<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MAX(x,y) (x &gt; y ? x : y)</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">insidepolygon(Point *polygon,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">N,Point p)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">counter = 0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span><span lang="EN-US" style="font-size:9.0pt;color:black">ers;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;Point p1,p2;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;p1 = polygon[0];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;=N;i++) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p2 = polygon[i % N];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(p.y &gt; MIN(p1.y,p2.y)) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(p.y &lt;= MAX(p1.y,p2.y)) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(p.x &lt;= MAX(p1.x,p2.x)) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(p1.y != p2.y) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span><span lang="EN-US" style="font-size:9.0pt;color:black">ers = (p.y-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(p1.x == p2.x || p.x &lt;= x</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span><span lang="EN-US" style="font-size:9.0pt;color:black">ers)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;counter++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p1 = p2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(counter % 2 == 0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(OUTSIDE);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(INSIDE);<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="21"></a><span lang="EN-US" style="font-size:9.0pt;color:black">6.判断点是否在线段上</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=Pointonline(Point p1,Point p2,Point p);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p1、p2：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">线段的两个端点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被判断点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">0：点在不在线段上；1：点在线段上</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">若<span lang="EN-US">p线段端点上返回1</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MIN(x,y) (x &lt; y ? x : y)<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MAX(x,y) (x &gt; y ? x : y)</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">FC(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x2)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(x1-x2&lt;0.000002&amp;&amp;x1-x2&gt;-0.000002)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    }<br>
                                    <br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Pointonline(Point p1,Point p2,Point p)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x1,y1,x2,y2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;x1=p.x-p1.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;x2=p2.x-p1.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;y1=p.y-p1.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;y2=p2.y-p1.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(FC(x1*y2-x2*y1,0)==0)</span> <span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((MIN(p1.x,p2.x)&lt;=p.x&amp;&amp;p.x&lt;=MAX(p1.x,p2.x))&amp;&amp;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(MIN(p1.y,p2.y)&lt;=p.y&amp;&amp;p.y&lt;=MAX(p1.y,p2.y)))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="22"></a><span lang="EN-US" style="font-size:9.0pt;color:black">7.判断两线段是否相交</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=sectintersect(Point p1,Point p2,Point p3,Point p4);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p1～4：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">两条线段的四个端点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">0：两线段不相交；1：两线段相交；2两线段首尾相接</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p1!=p2;p3!=p4;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MIN(x,y) (x &lt; y ? x : y)<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MAX(x,y) (x &gt; y ? x : y)</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">lineintersect(Point p1,Point p2,Point p3,Point p4)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;Point tp1,tp2,tp3;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((p1.x==p3.x&amp;&amp;p1.y==p3.y)||(p1.x==p4.x&amp;&amp;p1.y==p4.y)||(p2.x==p3.x&amp;&amp;p2.y==p3.y)||(p2.x==p4.x&amp;&amp;p2.y==p4.y))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">2;<br>
                                    //快速排斥试验<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((MIN(p1.x,p2.x)&lt;p3.x&amp;&amp;p3.x&lt;MAX(p1.x,p2.x)&amp;&amp;MIN(p1.y,p2.y)&lt;p3.y&lt;MAX(p1.y,p2.y))||<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(MIN(p1.x,p2.x)&lt;p4.x&amp;&amp;p3.x&lt;MAX(p1.x,p2.x)&amp;&amp;MIN(p1.y,p2.y)&lt;p3.y&lt;MAX(p1.y,p2.y)))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">//跨立试验<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp1.x=p1.x-p3.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp1.y=p1.y-p3.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp2.x=p4.x-p3.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp2.y=p4.y-p3.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp3.x=p2.x-p3.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp3.y=p2.y-p3.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((tp1.x*tp2.y-tp1.y*tp2.x)*(tp2.x*tp3.y-tp2.y*tp3.x)&gt;=0)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="23"></a><span lang="EN-US" style="font-size:9.0pt;color:black">8.判断线段与直线是否相交</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=lineintersect(Point p1,Point p2,Point p3,Point p4);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p1、p2：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">线段的两个端点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p3、p4：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">直线上的两个点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">0：线段直线不相交；1：线段和直线相交</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">如线段在直线上，返回 <span lang="EN-US">1</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">lineintersect(Point p1,Point p2,Point p3,Point p4)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;Point tp1,tp2,tp3;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp1.x=p1.x-p3.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp1.y=p1.y-p3.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp2.x=p4.x-p3.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp2.y=p4.y-p3.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp3.x=p2.x-p3.x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tp3.y=p2.y-p3.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((tp1.x*tp2.y-tp1.y*tp2.x)*(tp2.x*tp3.y-tp2.y*tp3.x)&gt;=0)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="24"></a><span lang="EN-US" style="font-size:9.0pt;color:black">9.点到线段最短距离</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=mindistance(Point p1,Point p2,Point q);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p1、p2：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">线段的两个端点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">q：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">判断点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">点<span lang="EN-US">q到线段p1p2的距离</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要 <span lang="EN-US">math.h</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MIN(x,y) (x &lt; y ? x : y)<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MAX(x,y) (x &gt; y ? x : y)</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">mindistance(Point p1,Point p2,Point q)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">flag=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">k;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;Point s;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(p1.x==p2.x) {s.x=p1.x;s.y=q.y;flag=0;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(p1.y==p2.y) {s.x=q.x;s.y=p1.y;flag=0;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(flag)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k=(p2.y-p1.y)/(p2.x-p1.x);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s.x=(k*k*p1.x+k*(q.y-p1.y)+q.x)/(k*k+1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s.y=k*(s.x-p1.x)+p1.y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(MIN(p1.x,p2.x)&lt;=s.x&amp;&amp;s.x&lt;=MAX(p1.x,p2.x))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">sqrt((q.x-s.x)*(q.x-s.x)+(q.y-s.y)*(q.y-s.y));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">MIN(sqrt((q.x-p1.x)*(q.x-p1.x)+(q.y-p1.y)*(q.y-p1.y)),sqrt((q.x-p2.x)*(q.x-p2.x)+(q.y-p2.y)*(q.y-p2.y)));<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal" style="margin-bottom:12.0pt">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="25"></a><span lang="EN-US" style="font-size:9.0pt;color:black">10.求两直线的交点</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=mindistance(Point p1,Point p2,Point q);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">p1～p4：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">直线上不相同的两点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">*p：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">通过指针返回结果</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">1：两直线相交；2：两直线平行</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">如需要判断两线段交点，检验<span lang="EN-US">k和对应k1（注释中）的值是否在0～1之间，用在0～1之间的那个求交点</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br>
                                    &nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">linecorss(Point p1,Point p2,Point p3,Point p4,Point *p)<br>
                                    {<br>
                                    &nbsp;<span style="mso-spacerun:yes">&nbsp;</span> double k;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;&nbsp;</span> //同一直线</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;</span> if ((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x)==0&amp;&amp;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> (p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x)==0) return 2;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;&nbsp;</span> //平行，不同一直线</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;</span> if ((p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y)==0) return 0;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;</span> k=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/((p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y));</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">//k1=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/((p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y));</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;&nbsp;</span> (*p).x=p1.x+k*(p2.x-p1.x);</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;&nbsp;</span> (*p).y=p1.y+k*(p2.y-p1.y);</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><span style="mso-spacerun:yes">&nbsp;&nbsp;</span> return 1;//有交点}</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal" style="margin-bottom:12.0pt">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="26"></a><span lang="EN-US" style="font-size:9.0pt;color:black">11.判断一个封闭图形是凹集还是凸集</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=convex(Point *p,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">*p：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">封闭曲线顶点数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">封闭曲线顶点个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">1：凸集；-1：凹集；0：曲线不符合要求无法计算</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">默认曲线为简单曲线：无交叉、无圈</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    } Point;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">convex(Point *p,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">flag = 0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">double</span> <span lang="EN-US" style="font-size:9.0pt;color:black">z;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(n &lt; 3)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(0);</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j = (i + 1) % n;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k = (i + 2) % n;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z = (p[j].x - p[i].x) * (p[k].y - p[j].y);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z -= (p[j].y - p[i].y) * (p[k].x - p[j].x);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(z &lt; 0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag |= 1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(z &gt; 0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag |= 2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(flag == 3)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">－1; //CONCAVE<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(flag != 0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1; //CONVEX<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="27"></a><span lang="EN-US" style="font-size:9.0pt;color:black">12.Graham扫描法寻找凸包</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">Graham_scan(Point PointSet[],Point ch[],</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">&amp;len);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">PointSet[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输入的点集</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">ch[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输出的凸包上的点集，按照逆时针方向排列</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">PointSet中的点的数目</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">len：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输出的凸包上的点的个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes;height:438.75pt">
                            <td style="padding:0cm 0cm 0cm 0cm;height:438.75pt">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm;height:438.75pt">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Point{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    };</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">multiply(Point p1,Point p2,Point p0)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">((p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y));<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">float</span> <span lang="EN-US" style="font-size:9.0pt;color:black">distance(Point p1,Point p2)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)));<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Graham_scan(Point PointSet[],Point ch[],</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">&amp;len)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k=0,top=2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;Point tmp;<br>
                                    <br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((PointSet[i].y&lt;PointSet[k].y)||((PointSet[i].y==PointSet[k].y)&amp;&amp;(PointSet[i].x&lt;PointSet[k].x)))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;k=i;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;tmp=PointSet[0];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;PointSet[0]=PointSet[k];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;PointSet[k]=tmp;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;n-1;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k=i;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=i+1;j&lt;n;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">( (multiply(PointSet[j],PointSet[k],PointSet[0])&gt;0) ||<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((multiply(PointSet[j],PointSet[k],PointSet[0])==0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;(distance(PointSet[0],PointSet[j])&lt;distance(PointSet[0],PointSet[k])))&nbsp;&nbsp;&nbsp;)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k=j;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmp=PointSet[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PointSet[i]=PointSet[k];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PointSet[k]=tmp;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;ch[0]=PointSet[0];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;ch[1]=PointSet[1];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;ch[2]=PointSet[2];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=3;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(multiply(PointSet[i],ch[top],ch[top-1])&gt;=0) top--;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch[++top]=PointSet[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;len=top+1;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <strong><span style="font-size:9.0pt;font-family:SimSun;mso-bidi-font-family: SimSun;color:black">四、数论</span></strong>
            </p>
            <p>
                <a name="28"></a><span lang="EN-US" style="font-size:9.0pt;color:black">1.x的二进制长度</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=BitLength(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">x：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">测长的<span lang="EN-US">x</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">x的二进制长度</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">BitLength(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d = 0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(x &gt; 0) {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x &gt;&gt;= 1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <a name="29"></a>2.返回x的二进制表示中从低到高的第i位</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=BitAt(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">x：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">十进制 <span lang="EN-US">x</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">i：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">要求二进制的第<span lang="EN-US">i位</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">返回<span lang="EN-US">x的二进制表示中从低到高的第i位</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">最低位为第一位</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">BitAt(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">( x &amp; (1 &lt;&lt; (i-1)) );<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="30"></a><span lang="EN-US" style="font-size:9.0pt;color:black">3.模取幂运算</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=Modular_Expoent(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a、b、n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a^b mod n 的对应参数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a^b mod n 的值</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">需要<span lang="EN-US">BitLength和BitAt</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Modular_Expoent(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i, y=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i = BitLength(b); i &gt; 0; i--)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = (y*y)%n;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(BitAt(b,i) &gt; 0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = (y*a)%n;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="31"></a><span lang="EN-US" style="font-size:9.0pt;color:black">4.求解模线性方程</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result＝modular_equation(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a、b、n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">ax=b (mod n) 的对应参数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">方程的解</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">ext_euclid(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">&amp;x,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">&amp;y)&nbsp; //求gcd(a,b)=ax+by<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t,d;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(b==0) {x=1;y=0;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;d=ext_euclid(b,a %b,x,y);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;t=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;x=y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;y=t-a/b*y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d;<br>
                                    }<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">modular_equation(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e,i,d;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x,y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;d=ext_euclid(a,n,x,y);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(b%d&gt;0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("No answer!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e=(x*(b/d))%n;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;d;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("The %dth answer is : %ld\n",i+1,(e+i*(n/d))%n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="32"></a><span lang="EN-US" style="font-size:9.0pt;color:black">5.求解模线性方程组(中国余数定理)</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=Modular_Expoent(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">B[]、W[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a=B[] (mod W[]) 的对应参数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a 的值</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">其中<span lang="EN-US">W[],B[]已知，W[i]&gt;0且W[i]与W[j]互质, 求a</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">ext_euclid(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">&amp;x,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">&amp;y)&nbsp; //求gcd(a,b)=ax+by<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t,d;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(b==0) {x=1;y=0;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;d=ext_euclid(b,a %b,x,y);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;t=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;x=y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;y=t-a/b*y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d;<br>
                                    }<br>
                                    <br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">China(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">B[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">W[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">k)<br>
                                    {<br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d,x,y,a=0,m,n=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;k;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n*=W[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;k;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m=n/W[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d=ext_euclid(W[i],m,x,y);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a=(a+y*m*B[i])%n;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(a&gt;0)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(a+n);<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="33"></a><span lang="EN-US" style="font-size:9.0pt;color:black">6.筛法素数产生器</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=prime(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">用于返回素数的数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">产生<span lang="EN-US">n以内的素数，按升序放入a[]中</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n以内素数的个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">其中<span lang="EN-US">W[],B[]已知，W[i]&gt;0且W[i]与W[j]互质, 求a</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">prime(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k,x,num,*b;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;n++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;n/=2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;b=(</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">*)malloc(sizeof(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span><span lang="EN-US" style="font-size:9.0pt;color:black">)*(n+1)*2);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;a[0]=2;a[1]=3;num=2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;=2*n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b[i]=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=3;i&lt;=n;i+=3)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;2;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x=2*(i+j)-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(b[x]==0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a[num++]=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(k=x;k&lt;=2*n;k+=x)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b[k]=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">num;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="34"></a><span lang="EN-US" style="font-size:9.0pt;color:black">7.判断一个数是否素数</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=comp(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">判断<span lang="EN-US">n是否素数</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">素数返回<span lang="EN-US">1，否则返回0</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">comp(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,flag=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=2;i&lt;=sqrt(n);i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(n%i==0) {flag=0;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(flag==1)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <strong><span style="font-size:9.0pt;font-family:SimSun;mso-bidi-font-family: SimSun;color:black">五、图论</span></strong>
            </p>
            <p>
                <a name="35"></a><span lang="EN-US" style="font-size:9.0pt;color:black">1.Prim算法求最小生成树</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">prim(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">vcount,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">father[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">G：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">图，用邻接矩阵表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">vcount：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">表示图的顶点个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">father[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">用来记录每个节点的父节点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">常数<span lang="EN-US">max_vertexes为图最大节点数</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">常数<span lang="EN-US">infinity为无穷大</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">infinity 1000000<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">max_vertexes 5<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Graph[max_vertexes][max_vertexes];<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">prim(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">vcount,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">father[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">lowcost[max_vertexes],closeset[max_vertexes],used[max_vertexes];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;vcount;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lowcost[i]=G[0][i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;closeset[i]=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used[i]=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;father[i]=-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;used[0]=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;vcount;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(used[j]) j++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(k=0;k&lt;vcount;k++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((!used[k])&amp;&amp;(lowcost[k]&lt;lowcost[j])) j=k;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;father[j]=closeset[j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used[j]=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(k=0;k&lt;vcount;k++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(!used[k]&amp;&amp;(G[j][k]&lt;lowcost[k]))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ lowcost[k]=G[j][k];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;closeset[k]=j; }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <a name="36"></a>2.Dijkstra算法求单源最短路径</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=Dijkstra(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">path[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">G：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">图，用邻接矩阵表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">图的顶点个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">s：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">开始节点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">目标节点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">path[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">用于返回由开始节点到目标节点的路径</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">最短路径长度</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输入的图的权必须非负</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">顶点标号从<span lang="EN-US">0开始</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:11">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">用如下方法打印路径：<span lang="EN-US"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;i=t;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span></span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i!=s)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("%d&lt;--",i+1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i=path[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("%d\n",s+1);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:12">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:13;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Dijkstra(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">path[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,w,minc,d[max_vertexes],mark[max_vertexes];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++) mark[i]=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ d[i]=G[s][i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path[i]=s; }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;mark[s]=1;path[s]=0;d[s]=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; minc=infinity;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;w=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;n;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((mark[j]==0)&amp;&amp;(minc&gt;=d[j])) {minc=d[j];w=j;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mark[w]=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;n;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">((mark[j]==0)&amp;&amp;(G[w][j]!=infinity)&amp;&amp;(d[j]&gt;d[w]+G[w][j]))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ d[j]=d[w]+G[w][j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path[j]=w; }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d[t];<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="37"></a><span lang="EN-US" style="font-size:9.0pt;color:black">3.Bellman-ford算法求单源最短路径</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=Bellman_ford(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">path[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">success);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">G：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">图，用邻接矩阵表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">图的顶点个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">s：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">开始节点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">目标节点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">path[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">用于返回由开始节点到目标节点的路径</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">success：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">函数是否执行成功</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">最短路径长度</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:10">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输入的图的权可以为负，如果存在一个从源点可达的权为负的回路则<span lang="EN-US">success=0</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:11">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">顶点标号从<span lang="EN-US">0开始</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:12">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">用如下方法打印路径：<span lang="EN-US"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;i=t;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span></span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i!=s)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("%d&lt;--",i+1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i=path[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("%d\n",s+1);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:13">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:14;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Bellman_ford(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">path[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">success)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k,d[max_vertexes];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++) {d[i]=infinity;path[i]=0;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;d[s]=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(k=1;k&lt;n;k++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;n;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(d[j]&gt;d[i]+G[i][j]) {d[j]=d[i]+G[i][j];path[j]=i;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;success=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;n;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(d[j]&gt;d[i]+G[i][j])</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;success=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">d[t];<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="38"></a><span lang="EN-US" style="font-size:9.0pt;color:black">4.Floyd-Warshall算法求每对节点间最短路径</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">Floyd_Washall(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,Graph D,Graph P);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">G：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">图，用邻接矩阵表示</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">图的顶点个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">D：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">D[i,j]表示从i到j的最短距离</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">P：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">P[i,j]表示从i到j的最短路径上j 的父节点</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">Floyd_Washall(Graph G,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,Graph D,Graph P)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;n;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ D[i][j]=G[i][j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P[i][j]=i; }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++) { D[i][i]=0;P[i][i]=0; }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(k=0;k&lt;n;k++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=0;j&lt;n;j++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(D[i][j]&gt;D[i][k]+D[k][j])<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ D[i][j]=D[i][k]+D[k][j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P[i][j]=P[k][j]; }<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <strong><span style="font-size:9.0pt;font-family:SimSun;mso-bidi-font-family: SimSun;color:black">六、排序<span lang="EN-US">/查找</span></span></strong>
            </p>
            <p>
                <a name="39"></a><span lang="EN-US" style="font-size:9.0pt;color:black">1.快速排序</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">quicksort(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">r,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[]);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">l：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">排序上界，开始时<span lang="EN-US">l=0</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">r：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">排序下界，开始时<span lang="EN-US">r=数组元素个数</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">b[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">被排序的元素</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输出升序序列</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">quicksort(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">l,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">r,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">b[])<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(l&gt;=r)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;i=l;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;j=r;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;x=b[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i!=j)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(b[j]&gt;x&amp;&amp;j&gt;i) j--;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i&lt;j)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b[i]=b[j];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(b[i]&lt;x&amp;&amp;j&gt;i)i++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i&lt;j)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b[j]=b[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j--;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;b[i]=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;quicksort(l,j-1,b);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;quicksort(i+1,r,b);<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <a name="40"></a>2.希尔排序</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">shellsort(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">数组元素个数</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">a[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">待排序数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输出升序序列</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">shellsort(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">a[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,g;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">temp,k;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;g=n/2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(g!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=g+1;i&lt;=n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp=a[i];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j=i-g;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j&gt;0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k=j+g;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(a[j]&lt;=a[k])<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp=a[j];a[j]=a[k];a[k]=temp;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j=j-g;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g=g/2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="41"></a><span lang="EN-US" style="font-size:9.0pt;color:black">3.选择排序</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">sort(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">待排序数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">n：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">数组<span lang="EN-US">t[]元素的个数</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">null</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">输出升序序列</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">小规模排序用</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:9;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">sort(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">t[],</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n)<br>
                                    {<br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,j,k,temp;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k=i;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j=i;j&lt;n;j++)</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(t[j]&lt;t[k]) k=j;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp=t[i];t[i]=t[k];t[k]=temp;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="42"></a><span lang="EN-US" style="font-size:9.0pt;color:black">4.二分查找</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">语法：</span><span lang="EN-US" style="font-size:9.0pt;color:black">result=search_bin(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">*t,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">k);</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1">
                            <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">参数：</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:2">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">t[]：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">待查找数组</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:3">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">k：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">查找关键字</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:4">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal" align="right" style="text-align:right">
                                    <span style="font-size:9.0pt;color:black">返回值：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">如果<span lang="EN-US">k在t[]中存在，输出i：t[i]=k，否则输出－1</span></span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:5">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">注意：</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:6">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:black">要求查找数组是有序升序序列</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:7">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:8;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">search_bin(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">*t,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">k)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">low=1,high=10,mid;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(low&lt;=high)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mid=(low+high)/2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(k==t[mid])</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">mid;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(k&lt;t[mid]) high=mid-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black">low=mid+1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">-1;<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <strong><span style="font-size:9.0pt;font-family:SimSun;mso-bidi-font-family: SimSun;color:black">七、数据结构</span></strong>
            </p>
            <p>
                <a name="43"></a><span lang="EN-US" style="font-size:9.0pt;color:black">1.顺序队列</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">maxsize 100<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">data[maxsize];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">front;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">rear;<br>
                                    }&nbsp;sqqueue;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">sqinit(sqqueue *p) //队列初始化<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p-&gt;front=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p-&gt;rear=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">enqueue(sqqueue *q,</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e) //入队<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">((q-&gt;rear+1)%maxsize==q-&gt;front)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q-&gt;data[q-&gt;rear]=e;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q-&gt;rear=(q-&gt;rear+1)%maxsize;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">dequeue(sqqueue *q) //出队<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;front==q-&gt;rear)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;e=q-&gt;data[q-&gt;front];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q-&gt;front=(q-&gt;front+1)%maxsize;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">empty(sqqueue *q)&nbsp; //判空<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">v;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;front==q-&gt;rear)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">v;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">gethead(sqqueue *q)&nbsp; //取得头元素<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;front==q-&gt;rear)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e=-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e=q-&gt;data[q-&gt;front];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">display(sqqueue *q) //显示所有元素<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">s;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s=q-&gt;front;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("the sequeue is display:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;front==q-&gt;rear)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("the sequeue is empty!");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s&lt;q-&gt;rear)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("-&gt;%d", q-&gt;data[s]);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s=(s+1)%maxsize;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("\n");<br>
                                    }<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">main(sqqueue *head)&nbsp; //函数使用样例<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,i,m,x,y,select,xq;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("create a empty sequeue\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;sqinit(head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("please input the sequeue length:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("please input a sequeue value:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;m);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enqueue(head,m);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("head-&gt;rear:%d\n",head-&gt;rear);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("head-&gt;front:%d\n",head-&gt;front);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;display(head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 1 **** enqueue() \n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 2 **** dequeue() \n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 3 **** empty () \n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 4 **** gethead() \n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 5 **** display() \n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("please select (1--5):");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;select);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">switch</span><span lang="EN-US" style="font-size:9.0pt;color:black">(select)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("please input a value :\n ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;x);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enqueue(head,x);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">2:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dequeue(head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">3:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(empty(head))<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("the sequeue is empty");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("the sequeue is full");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">4:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y=gethead(head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("output head value:%d\n",y);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">5:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p>
                <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                <a name="44"></a>2.顺序栈</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">#define</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m 100<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">stack[m];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">top;<br>
                                    } stackstru;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">init(stackstru *s) /*装入栈*/<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">push(stackstru *s,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x) /*入栈操作*/<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(s-&gt;top==m)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("the stack is overflow!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top=s-&gt;top+1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;stack[s-&gt;top]=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">display(stackstru *s) /*显示栈所有数据*/<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s-&gt;top==0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("the stack is empty!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s-&gt;top!=0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("%d-&gt;",s-&gt;stack[s-&gt;top]);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top=s-&gt;top-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">pop(stackstru *s) /*出栈操作并返回被删除的那个记录*/<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s-&gt;top==0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("the stack is empty!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y=s-&gt;stack[s-&gt;top];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top=s-&gt;top-1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">y;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">gettop(stackstru *s) /*得到栈顶数*/<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s-&gt;top==0)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e=s-&gt;stack[s-&gt;top];<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">main(stackstru *p) //函数使用演示<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,i,k,h,x1,x2,select;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("create a empty stack!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;init(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("input a stack length:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=0;i&lt;n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("input a stack value:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;k);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push(p,k);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 1:display()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 2:push()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 3:pop()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 4:gettop()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("input a your select(1-4):\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;select);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">switch</span><span lang="EN-US" style="font-size:9.0pt;color:black">(select)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">2:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("input a push a value:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;h);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push(p,h);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">3:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x1=pop(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("x1-&gt;%d\n",x1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">4:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x2=gettop(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("x2-&gt;%d",x2);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="45"></a><span lang="EN-US" style="font-size:9.0pt;color:black">3.链表</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"># define null 0<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">ElemType; /* 字符型数据*/<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;ElemType data;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *next;<br>
                                    };<br>
                                    <br>
                                    setnull(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p);<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">length (</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p);<br>
                                    ElemType get(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i);<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">insert(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p,ElemType x,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i);<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">delete(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i);<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">display(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p);</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">main()<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *head,*q; /*定义静态变量*/<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">select,x1,x2,x3,x4;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i,n;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">m,g;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e,y;<br>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;head=setnull(&amp;head); /*建议链表并设置为空表*/<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("请输入数据长度: ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;n;i++);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("将数据插入到单链表中: ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;y);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;insert(&amp;head,y,i);} /*插入数据到链表*/<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(&amp;head); /*显示链表所有数据*/<br>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("select 1 求长度 length()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("select 2 取结点 get()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("select 3 求值查找 locate()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("select 4 删除结点 delete()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("input your select: ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;select);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">switch</span><span lang="EN-US" style="font-size:9.0pt;color:black">(select)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x1=length(&amp;head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("输出单链表的长度%d ",x1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(&amp;head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">2:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("请输入要取得结点: ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;m);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x2=get(&amp;head,m);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(x2);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(&amp;head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">3:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("请输入要查找的数据: ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;e);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x3=locate(&amp;head,e);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(x3);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(&amp;head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">4:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("请输入要删除的结点: ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;g);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x4=delete(&amp;head,g);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(x4);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(&amp;head);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    setnull(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;*p=null;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">length (</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *q=*p;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(q!=null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(n);<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">ElemType get(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">j=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *q=*p;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(j&lt;i&amp;&amp;q!=null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(q!=null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;data);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("位置参数不正确!\n");<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">locate(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p,ElemType x)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *q=*p;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">while</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(q!=null&amp;&amp;q-&gt;data!=x)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(q==null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(-1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">(n+1);<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">insert(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p,ElemType x,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">j=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *s,*q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s=(</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *)malloc(sizeof(</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s-&gt;data=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q=*p;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i==1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;next=q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p=s;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j&lt;i-1&amp;&amp;q-&gt;next!=null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j==i-1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;next=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q-&gt;next=s;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("位置参数不正确!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">delete(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">i)<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">j=1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *q=*p,*t;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(i==1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t=q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*p=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(j&lt;i-1&amp;&amp;q-&gt;next!=null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j++;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;next!=null&amp;&amp;j==i-1)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q-&gt;next=t-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("位置参数不正确!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(t=null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;free(t);<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">display(</span><span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode **p)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">LNode *q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q=*p;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("单链表显示: ");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(q==null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("链表为空!");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;next==null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("%c\n",q-&gt;data);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(q-&gt;next!=null)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("%c-&gt;",q-&gt;data);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q=q-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("%c",q-&gt;data);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("\n");<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="46"></a><span lang="EN-US" style="font-size:9.0pt;color:black">4.链栈</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black"># define null 0<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">stacknode<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">data;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">stacknode *next;<br>
                                    } stacklink;<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;stacklink *top;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">stacksize;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;}stackk;<br>
                                    <br>
                                    initlink(stackk *s)<br>
                                    {<br>
                                    &nbsp;&nbsp; s-&gt;top=(stacklink *)malloc(sizeof(stacklink));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top-&gt;data=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top-&gt;next=null;<br>
                                    }<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">poplink(stackk *s)<br>
                                    {<br>
                                    &nbsp;&nbsp; stackk *p;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">v;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s-&gt;top-&gt;next==null) printf("the stackis empty\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v=s-&gt;top-&gt;next-&gt;data;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p=s-&gt;top-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top=s-&gt;top-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;free(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">v;<br>
                                    }<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">pushlink(stackk *s,</span><span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x)<br>
                                    {<br>
                                    &nbsp;&nbsp; stackk *p;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p=(stacklink *)malloc(sizeof(stacklink));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p-&gt;data=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p-&gt;next=s-&gt;top-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;s-&gt;top-&gt;next=p;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">gettop(stackk *s)<br>
                                    {<br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(s==null) printf("the stack is empty!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;e=s-&gt;top-&gt;next-&gt;data;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">e;<br>
                                    }<br>
                                    <br>
                                    display(stackk *s)<br>
                                    {<br>
                                    &nbsp;&nbsp; stackk *p;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;p=s-&gt;top-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("display the stacklink:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(s-&gt;top=null) printf("the stacklink is empty!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">while</span><span lang="EN-US" style="font-size:9.0pt;color:black">(p)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("-&gt;%d",p-&gt;data);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p=p-&gt;next;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }<br>
                                    <br>
                                    main(stacklink *p)<br>
                                    {<br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n,k,i,select,h,x1,x2;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("create a empty stacklink!\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;initlink(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("input a stacklink length:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">for</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(i=1;i&lt;=n;i++)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{printf("input a stacklink value:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;k);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;pushlink(p,k);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 1:display()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 2:pushlink()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 3:poplink()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("select 4:gettop()\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("input a your select(1-4):\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;select);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">switch</span><span lang="EN-US" style="font-size:9.0pt;color:black">(select)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">1:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {display(p);</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">2:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {printf("input a push a value :\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d",&amp;h);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pushlink(p,h);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">3:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {x1=poplink(p);printf("x1-&gt;%d\n",x1);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display(p);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">case</span> <span lang="EN-US" style="font-size:9.0pt;color:black">4:<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {x2=gettop(p);printf("x2-&gt;%d",x2);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">break</span><span lang="EN-US" style="font-size:9.0pt;color:black">;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
            </p>
            <p>
                <a name="47"></a><span lang="EN-US" style="font-size:9.0pt;color:black">5.二叉树</span>
            </p>
            <div align="center">
                <table class="MsoNormalTable" border="0" cellspacing="5" cellpadding="0" width="80%" style="width:80.0%;mso-cellspacing:3.7pt;mso-padding-alt:0cm 0cm 0cm 0cm">
                    <tbody>
                        <tr style="mso-yfti-irow:0">
                            <td width="12%" style="width:12.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span style="font-size:9.0pt;color:#3366FF">源程序：</span>
                                </p>
                            </td>
                            <td width="88%" style="width:88.0%;padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                        </tr>
                        <tr style="mso-yfti-irow:1;mso-yfti-lastrow:yes">
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:black">&nbsp;</span>
                                </p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                                <p class="MsoNormal">
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">typedef</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">bitnode<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">data;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">struct</span> <span lang="EN-US" style="font-size:9.0pt;color:black">bitnode *lchild, *rchild;<br>
                                    }bitnode, *bitree;</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">createbitree(t,n)<br>
                                    bitnode ** t;<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">*n;<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">char</span> <span lang="EN-US" style="font-size:9.0pt;color:black">x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;bitnode *q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;*n=*n+1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("\n Input %d DATA:",*n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;x=getchar();<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(x!='\n') getchar();<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(x=='\n')<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q=(bitnode*)malloc(sizeof(bitnode));<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q-&gt;data=x;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q-&gt;lchild=NULL;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;q-&gt;rchild=NULL;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;*t=q;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf(" This Address is: %o, Data is: %c,\n Left Pointer is: %o, Right Pointer is: %o",q,q-&gt;data,q-&gt;lchild,q-&gt;rchild);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;createbitree(&amp;q-&gt;lchild,n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;createbitree(&amp;q-&gt;rchild,n);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    }<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">visit(e)<br>
                                    bitnode *e;<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf(" Address: %o, Data: %c, Left Pointer: %o, Right Pointer: %o\n",e,e-&gt;data,e-&gt;lchild,e-&gt;rchild);<br>
                                    }<br>
                                    <br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">preordertraverse(t)<br>
                                    bitnode *t;<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(t)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;visit(t);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preordertraverse(t-&gt;lchild);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preordertraverse(t-&gt;rchild);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">void</span> <span lang="EN-US" style="font-size:9.0pt;color:black">countleaf(t,c)<br>
                                    bitnode *t;<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">*c;<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(t!=NULL)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt;color:blue">if</span> <span lang="EN-US" style="font-size:9.0pt;color:black">(t-&gt;lchild==NULL &amp;&amp; t-&gt;rchild==NULL)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{*c=*c+1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;countleaf(t-&gt;lchild,c);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;countleaf(t-&gt;rchild,c);<br>
                                    }<br></span> <span lang="EN-US" style="font-size:9.0pt;color:blue">return</span><span lang="EN-US" style="font-size:9.0pt;color:black">;<br>
                                    }</span>
                                </p>
                                <p>
                                    <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">treehigh(t)<br>
                                    bitnode *t;<br>
                                    {<br>
                                    &nbsp;&nbsp;</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">lh,rh,h;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">if</span><span lang="EN-US" style="font-size:9.0pt;color:black">(t==NULL)<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">else</span><span lang="EN-US" style="font-size:9.0pt;color:black"><br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lh=treehigh(t-&gt;lchild);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rh=treehigh(t-&gt;rchild);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h=(lh&gt;rh ? lh:rh)+1;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">return</span> <span lang="EN-US" style="font-size:9.0pt;color:black">h;<br>
                                    }<br>
                                    <br>
                                    main()<br>
                                    {<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;bitnode *t;</span> <span lang="EN-US" style="font-size: 9.0pt;color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt; color:black">count=0;<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span><span lang="EN-US" style="font-size:9.0pt; color:blue">int</span> <span lang="EN-US" style="font-size:9.0pt;color:black">n=0;<br>
                                    &nbsp;&nbsp; printf("\n Please input TREE Data:\n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;createbitree(&amp;t,&amp;n);<br>
                                    &nbsp;&nbsp; printf("\n This is TREE</span> <span lang="EN-US" style="font-size:9.0pt;color:blue">struct</span><span lang="EN-US" style="font-size:9.0pt;color:black">: \n");<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;preordertraverse(t);<br>
                                    &nbsp;&nbsp; countleaf(t,&amp;count);<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;printf("\n This TREE has %d leaves ",count);<br>
                                    &nbsp;&nbsp; printf(" , High of The TREE is: %d\n",treehigh(t));<br>
                                    }</span>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <p class="MsoNormal">
                <span lang="EN-US">&nbsp;</span>
            </p>
        </div>
    
    </body>
</html>